package cn.tedu.xuecha.server.service;
import cn.tedu.xuecha.server.bo.ContentBO;
import cn.tedu.xuecha.server.protocol.query.ContentQuery;
import cn.tedu.xuecha.server.repository.ContentRepository;
import cn.tedu.xuecha.server.protocol.param.ContentParam;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class ContentService {

    @Autowired
    private ContentRepository contentRepository;

    public Long insert(ContentBO contentBO){
        return  contentRepository.insert(contentBO);
    }

    public int delete(Integer id){
        return contentRepository.deleteById(id);
    }

    public List<ContentQuery> list(){
        return contentRepository.list();
    }

    public int update(ContentBO contentBO){
        return contentRepository.update(contentBO);
    }
}
